import java.util.Properties;

public class SystemPropertiesExample {
    public static void main(String[] args) {
        // 获取系统属性集
        Properties systemProperties = System.getProperties();

        // 打印一些常见的系统属性
        System.out.println("Java Runtime Version: " + systemProperties.getProperty("java.runtime.version"));
        System.out.println("Java Version: " + systemProperties.getProperty("java.version"));
        System.out.println("Java Vendor: " + systemProperties.getProperty("java.vendor"));
        System.out.println("Java Home: " + systemProperties.getProperty("java.home"));
        System.out.println("Java Class Path: " + systemProperties.getProperty("java.class.path"));
        System.out.println("Java Library Path: " + systemProperties.getProperty("java.library.path"));
        System.out.println("Operating System: " + systemProperties.getProperty("os.name"));
        System.out.println("Operating System Version: " + systemProperties.getProperty("os.version"));
        System.out.println("Operating System Architecture: " + systemProperties.getProperty("os.arch"));
        System.out.println("User Home Directory: " + systemProperties.getProperty("user.home"));
        System.out.println("User Directory: " + systemProperties.getProperty("user.dir"));

        // 你也可以遍历所有的系统属性
        for (String key : systemProperties.stringPropertyNames()) {
            System.out.format("%s = %s%n", key, systemProperties.getProperty(key));
        }
    }
}
